# Flask + Gunicorn with balancer Nginx on docker-compose 
## Setup
___
Install docker-compose, git and curl:
``` 
sudo apt update
sudo apt install docker-compose -y
sudo apt install git -y
sudo apt install curl
```
## Import git
Import git and moving to directory:
___
```
git clone https://gitverse.ru/sc/nero/flask_nginx_2.git
cd flask_nginx_2
```
## Start
___
Start docker-compose:
```
sudo docker-compose up --build -d
```
or:
```
sudo docker-compose up --build 
```
![result of work balancer+flask](test.jpeg)

## Checking HTTPS
___ 
We copy the certificate from the container:
```
sudo docker cp  flask_nginx_2_loadbalancer_1:/etc/nginx/server.crt /usr/local/share/ca-certificates/
```
Run to update the list of trusted certificates:
```
sudo update-ca-certificates
```
Add host:
```
chmod +x host.sh
sudo ./host.sh
```
Checking ssl/tls:
```
curl -s -L https://flask.com && echo
```
If output like:
```
Hello, World!
```
Then you did it right!